package com.neusoft.a312cxy.android18cxy.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.neusoft.a312cxy.android18cxy.R;
import com.neusoft.a312cxy.android18cxy.bean.MyguanzhuBean;

import java.util.List;

/**
 * Created by Young on 2017/11/10.
 */

public class GuanzhuAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
    private Context mContext;
    private List<MyguanzhuBean> mDataList1;
    private LayoutInflater mLayoutInflater;


    public GuanzhuAdapter(Context mContext, List<MyguanzhuBean> mDataList) {
        this.mContext = mContext;
        this.mDataList1 = mDataList;
        mLayoutInflater = LayoutInflater.from(mContext);
    }

    @Override
    public  GuanzhuAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View v = mLayoutInflater.inflate(R.layout.cardview_guanzhu, parent, false);
        return new GuanzhuAdapter.ViewHolder(v);


    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        final MyguanzhuBean entity =  mDataList1.get(position);
        if (null == entity)
            return;
        GuanzhuAdapter.ViewHolder viewHolder = (GuanzhuAdapter.ViewHolder) holder;

        viewHolder.insert_time.setText(entity.getInsert_time());
        viewHolder.name.setText(entity.getName());




    }

    @Override
    public int getItemCount() {
        return mDataList1.size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
     //   ImageView photo;
        TextView name, insert_time;




        public ViewHolder(View itemView) {
            super(itemView);
          //  photo= (ImageView) itemView.findViewById(R.id.photo);

            insert_time= (TextView) itemView.findViewById(R.id.insert_time);
            name=(TextView) itemView.findViewById( R.id.name);



        }
    }

 /*   public void upreply(String shaitu_id,String userid,String 	reply_userid final PostListener postListener){

    }*/
}
